home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CUGUK / COMMS / C028.ZIP / SZ.1 < prev    next >
Text File  |  1990-01-31  |  13KB  |  483 lines

  1. '\" Revision Level 
  2. '\" Last Delta     04-21-88
  3. .TH SZ 1 OMEN
  4. .SH NAME
  5. sx, sb, sz \- XMODEM, YMODEM, ZMODEM file send
  6. .SH SYNOPSIS
  7. sz
  8. .RB [\- +abdefkLlNnopqTtuvyY ]
  9. .I file ...
  10. .br
  11. sb
  12. .RB [\- adfkqtuv ]
  13. .I file ...
  14. .br
  15. sx
  16. .RB [\- akqtuv ]
  17. .I file
  18. .br
  19. sz
  20. .RB [\- oqtv ]
  21. .B "-c COMMAND"
  22. .br
  23. sz
  24. .RB [\- oqtv ]
  25. .B "-i COMMAND"
  26. .br
  27. sz -TT
  28. .SH DESCRIPTION
  29. .B Sz
  30. uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
  31. one or more files over a dial-in serial port to a variety of programs running under
  32. PC-DOS, CP/M, Unix, VMS, and other operating systems.
  33.  
  34. While
  35. .I rz
  36. is smart enough to be called from
  37. .I cu(1),
  38. very few versions of
  39. .I cu(1)
  40. are smart enough to allow
  41. .I sz
  42. to work properly.
  43. Unix flavors of Professional-YAM are available for such dial-out application.
  44.  
  45.  
  46. .B Sz
  47. sends one or more files with ZMODEM protocol.
  48.  
  49. ZMODEM
  50. greatly simplifies file transfers compared to XMODEM.
  51. In addition to a friendly user interface, ZMODEM
  52. provides Personal Computer and other users
  53. an efficient, accurate, and robust file transfer method.
  54.  
  55. ZMODEM provides complete
  56. .B "END-TO-END"
  57. data integrity between application programs.
  58. ZMODEM's 32 bit CRC catches errors
  59. that sneak into even the most advanced networks.
  60.  
  61. Advanced file management features include
  62. AutoDownload (Automatic file Download initiated without user intervention),
  63. Display of individual and total file lengths and transmission time estimates,
  64. Crash Recovery,
  65. selective file transfers,
  66. and preservation of
  67. exact file date and length.
  68.  
  69. Output from another program may be piped to
  70. .B sz
  71. for transmission by denoting standard input with "-":
  72. .ce
  73. ls -l | sz -
  74. The program output is transmitted with the filename sPID.sz
  75. where PID is the process ID of the
  76. .B sz
  77. program.
  78. If the environment variable
  79. .B ONAME
  80. is set, that is used instead.
  81. In this case, the Unix command:
  82. .ce
  83. ls -l | ONAME=con sz -ay -
  84. will send a "file" to the PC-DOS console display.
  85. The
  86. .B -y
  87. option instructs the receiver to open the file for writing unconditionally.
  88. The
  89. .B -a
  90. option
  91. causes the receiver to convert Unix newlines to PC-DOS carriage returns
  92. and linefeeds.
  93.  
  94.  
  95. .B Sb
  96. batch sends one or more files with YMODEM or ZMODEM protocol.
  97. The initial ZMODEM initialization is not sent.
  98. When requested by the receiver,
  99. .B sb
  100. supports
  101. .B YMODEM-g
  102. with "cbreak" tty mode, XON/XOFF flow control,
  103. and interrupt character set to CAN (^X).
  104. .B YMODEM-g
  105. (Professional-YAM
  106. .B g
  107. option)
  108. increases throughput over error free channels
  109. (direct connection, X.PC, etc.)
  110. by not acknowledging each transmitted sector.
  111.  
  112. On
  113. .SM Unix
  114. systems, additional information about the file is transmitted.
  115. If the receiving program uses this information,
  116. the transmitted file length controls the exact number of bytes written to
  117. the output dataset,
  118. and the modify time and file mode
  119. are set accordingly.
  120.  
  121.  
  122. .B Sx
  123. sends a single
  124. .I file
  125. with
  126. .B XMODEM
  127. or
  128. .B XMODEM-1k
  129. protocol
  130. (sometimes incorrectly called "ymodem").
  131. The user must supply the file name to both sending and receiving programs.
  132.  
  133. Iff
  134. .B sz
  135. is invoked with $SHELL set and iff that variable contains the
  136. string
  137. .I "rsh"
  138. or
  139. .I "rksh"
  140. (restricted shell),
  141. .B sz
  142. operates in restricted mode.
  143. Restricted mode restricts pathnames to the current directory and
  144. PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
  145. thereof.
  146.  
  147.  
  148. The fourth form sends a single COMMAND to a ZMODEM receiver for execution.
  149. .B Sz
  150. exits with the COMMAND return value.
  151. If COMMAND includes spaces or characters special to the shell,
  152. it must be quoted.
  153.  
  154.  
  155. The fifth form sends a single COMMAND to a ZMODEM receiver for execution.
  156. .B Sz
  157. exits as soon as the receiver has correctly received the command,
  158. before it is executed.
  159.  
  160.  
  161. The sixth form (sz -TT)
  162. attempts to output all 256 code combinations to the terminal.
  163. In you are having difficulty sending files,
  164. this command lets you see which character codes are being
  165. eaten by the operating system.
  166.  
  167.  
  168. If
  169. .B sz
  170. is invoked with stdout and stderr to different datasets,
  171. Verbose is set to 2, causing frame by frame progress reports
  172. to stderr.
  173. This may be disabled with the
  174. .B q
  175. option.
  176. .PP
  177. The meanings of the available options are:
  178. .PP
  179. .PD 0
  180. .TP
  181. \\
  182. (backslash) (VMS) Force the next option letter to upper case.
  183. .TP
  184. .B +
  185. Instruct the receiver to append transmitted data to an existing file
  186. (ZMODEM only).
  187. .TP
  188. .B a
  189. Convert NL characters in the transmitted file to CR/LF.
  190. This is done by the sender for XMODEM and YMODEM, by the receiver
  191. for ZMODEM.
  192. .TP
  193. .B b
  194. (ZMODEM) Binary override: transfer file without any translation.
  195. .TP
  196. .B "c COMMAND"
  197. Send COMMAND to the receiver for execution, return with COMMAND\'s exit status.
  198. .TP
  199. .B d
  200. Change all instances of "." to "/" in the transmitted pathname.
  201. Thus, C.omenB0000 (which is unacceptable to MSDOS or CP/M)
  202. is transmitted as C/omenB0000.
  203. If the resultant filename has more than 8 characters in the stem,
  204. a "." is inserted to allow a total of eleven.
  205. .TP
  206. .B e
  207. Escape all control characters;
  208. normally XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped.
  209. .TP
  210. .B f
  211. Send Full pathname.
  212. Normally directory prefixes are stripped from the transmitted
  213. filename.
  214. .TP
  215. .B "i COMMAND"
  216. Send COMMAND to the receiver for execution, return Immediately
  217. upon the receiving program's successful recption of the command.
  218. .TP
  219. .B k
  220. (XMODEM/YMODEM) Send files using 1024 byte blocks
  221. rather than the default 128 byte blocks.
  222. 1024 byte packets speed file transfers at high bit rates.
  223. (ZMODEM streams the data for the best possible throughput.)
  224. .TP
  225. .B "L N"
  226. Use ZMODEM sub-packets of length N.
  227. A larger N (32 <= N <= 1024) gives slightly higher throughput,
  228. a smaller N speeds error recovery.
  229. The default is 128 below 300 baud, 256 above 300 baud, or 1024 above 2400 baud.
  230. .TP
  231. .B "l N"
  232. Wait for the receiver to acknowledge correct data every
  233. .B N
  234. (32 <= N <= 1024)
  235. characters.
  236. This may be used to avoid network overrun when XOFF flow control is lacking.
  237. .TP
  238. .B n
  239. (ZMODEM) Send each file if
  240. destination file does not exist.
  241. Overwrite destination file if
  242. source file is newer than the destination file.
  243. .TP
  244. .B N
  245. (ZMODEM) Send each file if
  246. destination file does not exist.
  247. Overwrite destination file if
  248. source file is newer or longer than the destination file.
  249. .TP
  250. .B o
  251. (ZMODEM) Disable automatic selection of 32 bit CRC.
  252. .TP
  253. .B p
  254. (ZMODEM) Protect existing destination files by skipping transfer if the
  255. destination file exists.
  256. .TP
  257. .B q
  258. Quiet suppresses verbosity.
  259. .TP
  260. .B r
  261. (ZMODEM) Resume interrupted file transfer.
  262. If the source file is longer than the destination file,
  263. the transfer commences at the offset in the source file that equals
  264. the length of the destination file.
  265. .TP
  266. .B "t tim"
  267. Change timeout to
  268. .I tim
  269. tenths of seconds.
  270. .TP
  271. .B u
  272. Unlink the file after successful transmission.
  273. .TP
  274. .B "w N"
  275. Limit the transmit window size to N bytes (ZMODEM).
  276. .TP
  277. .B v
  278. Verbose
  279. causes a list of file
  280. names to be appended to
  281. /tmp/szlog .
  282. More v's generate more output.
  283. .TP
  284. .B y
  285. Instruct a ZMODEM receiving program to overwrite any existing file
  286. with the same name.
  287. .TP
  288. .B Y
  289. Instruct a ZMODEM receiving program to overwrite any existing file
  290. with the same name,
  291. and to skip any source files that do have a file with the same
  292. pathname on the destination system.
  293. .PD
  294. .SH EXAMPLES
  295. .ne 7
  296. .B "ZMODEM File Transfer"
  297. (Unix to DSZ/ZCOMM/Professional-YAM)
  298. .br
  299. .B "% sz \-a *.c"
  300. .br
  301. This single command transfers all .c files in the current Unix directory
  302. with conversion
  303. .RB ( \-a )
  304. to end of line conventions appropriate to the receiving environment.
  305. With ZMODEM AutoDownload enabled, Professional-YAM  and ZCOMM
  306. will automatically recieve
  307. the files after performing a security check.
  308.  
  309. .br
  310. .B "% sz \-Yan *.c *.h"
  311. .br
  312. Send only the .c and .h files that exist on both systems,
  313. and are newer on the sending system than the
  314. corresponding version on the receiving system, converting Unix to
  315. DOS text format.
  316. .br
  317. .B
  318. $ sz -\\Yan file1.c file2.c file3.c foo.h baz.h
  319. .R
  320. (for VMS)
  321. .br
  322.  
  323. .B "ZMODEM Command Download"
  324. (Unix to Professional-YAM)
  325. .br
  326.  cpszall:all
  327.     sz \-c "c:;cd /yam/dist"
  328.     sz \-ya $(YD)/*.me
  329.     sz \-yqb y*.exe
  330.     sz \-c "cd /yam"
  331.     sz \-i "!insms"
  332. .br
  333. This Makefile fragment uses
  334. .B sz
  335. to issue commands to Professional-YAM to change current disk and directory.
  336. Next,
  337. .B sz
  338. transfers the
  339. .I .me
  340. files from the $YD directory, commanding the receiver to overwrite the old files
  341. and to convert from Unix end of line conventions to PC-DOS conventions.
  342. The third line transfers some
  343. .I .exe
  344. files.
  345. The fourth and fifth lines command Pro-YAM to
  346. change directory and execute a PC-DOS batch file
  347. .I insms .
  348. Since the batch file takes considerable time, the
  349. .B "\-i"
  350. form is used to allow
  351. .B sz
  352. to exit immediately.
  353.  
  354. .B "XMODEM File Transfer"
  355. (Unix to Crosstalk)
  356. .br
  357. %
  358. .B "sx \-a foo.c"
  359. .br
  360. .B "ESC"
  361. .br
  362. .B "rx foo.c"
  363. .br
  364. The above three commands transfer a single file
  365. from Unix to a PC and Crosstalk with
  366. .I sz
  367. translating Unix newlines to DOS CR/LF.
  368. This combination is much slower and far less reliable than ZMODEM.
  369. .SH ERROR MESSAGES
  370. "Caught signal 99"
  371. indicates the program was not properly compiled,
  372. refer to "bibi(99)" in rbsb.c for details.
  373. .SH SEE ALSO
  374. rz(omen),
  375. ZMODEM.DOC,
  376. YMODEM.DOC,
  377. Professional-YAM,
  378. crc(omen),
  379. sq(omen),
  380. todos(omen),
  381. tocpm(omen),
  382. tomac(omen),
  383. yam(omen)
  384.  
  385. Compile time options required for various operating systems are described in
  386. the source file.
  387. .SH "VMS VERSION"
  388. The VMS version does not support wild cards.
  389. Because of VMS DCL, upper case option letters muse be represented
  390. by \\ proceding the letter.
  391.  
  392. The current VMS version does not support XMODEM, XMODEM-1k, or YMODEM.
  393.  
  394. VMS C Standard I/O and RMS may interact to modify the file contents.
  395. .SH FILES
  396. 32 bit CRC code courtesy Gary S. Brown.
  397.  
  398. sz.c, crctab.c, rbsb.c, zm.c, zmodem.h Unix source files
  399.  
  400. sz.c, crctab.c, vrzsz.c, zm.c, zmodem.h, vmodem.h, vvmodem.c,
  401. VMS source files.
  402.  
  403. /tmp/szlog stores debugging output (sz -vv)
  404. (szlog on VMS).
  405. .SH "TESTING FEATURE"
  406. The command "sz -T file"
  407. exercises the
  408. .B Attn
  409. sequence error recovery by commanding
  410. errors with unterminated packets.
  411. The receiving program should complain five times about
  412. binary data packets being too long.
  413. Each time
  414. .B sz
  415. is interrupted,
  416. it should send a ZDATA header followed by another defective packet.
  417. If the receiver does not detect five long data packets,
  418. the
  419. .B Attn
  420. sequence is not interrupting the sender, and the
  421. .B Myattn
  422. string in
  423. .B sz.c
  424. must be modified.
  425.  
  426. After 5 packets,
  427. .B sz
  428. stops the "transfer" and
  429. prints the total number of characters "sent" (Tcount).
  430. The difference between Tcount and 5120 represents the number of characters
  431. stored in various buffers when the Attn sequence is generated.
  432. .SH BUGS
  433. Calling
  434. .I sz
  435. from most versions of cu(1) doesn't work because cu's receive process
  436. fights
  437. .I sz
  438. for characters from the modem.
  439.  
  440. On at least one BSD system, sz would hang or exit when it got within
  441. a few kilobytes of the end of file.
  442. Using the "-w 8192" flag fixed the problem.
  443. The real cause is unknown, perhaps a bug in the kernel TTY output routines.
  444.  
  445. Programs that do not properly implement the specified file transfer protocol
  446. may cause
  447. .I sz
  448. to "hang" the port for a minute or two.
  449. This problem is corrected by using
  450. ZCOMM, Pro-YAM, or other program with a correct implementation
  451. of the specified protocol.
  452.  
  453. Many programs claiming to support YMODEM only support XMODEM with 1k blocks,
  454. and they often don't get that quite right.
  455.  
  456. XMODEM transfers add up to 127 garbage bytes per file.
  457. XMODEM-1k and YMODEM-1k transfers use 128 byte blocks
  458. to avoid extra padding.
  459.  
  460. YMODEM programs use the file length transmitted at the beginning of the
  461. transfer to prune the file to the correct length; this may cause problems with
  462. source files that grow during the course of the transfer.
  463. This problem does not pertain to ZMODEM transfers, which preserve the exact
  464. file length unconditionally.
  465.  
  466. Most ZMODEM options are merely passed to the receiving program;
  467. some do not implement all these options.
  468.  
  469. Circular buffering and a ZMODEM sliding window should be used
  470. when input is from pipes instead of acknowledging frames each 1024 bytes.
  471. If no files can be opened,
  472. .B sz
  473. sends a ZMODEM command to echo a suitable complaint;
  474. perhaps it should check for the presence of at least one accessible file before
  475. getting hot and bothered.
  476. The test mode leaves a zero length file on the receiving system.
  477.  
  478. A few high speed modems have a firmware bug that drops characters when the
  479. direction of high speed transmissson is reversed.
  480. The environment variable ZNULLS may be used to specify the number of nulls to
  481. send before a ZDATA frame.
  482. Values of 101 for a 4.77 mHz PC and 124 for an AT are typical.
  483.